<?php

namespace app\admin\controller\area;

use app\admin\service\CityTreeService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 * CityTree 控制器
 * Class CityTree
 * @package app\area\controller
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 */
class CityTree
{
    private Request $request;

    private CityTreeService $service;

    public function __construct(Request $request, CityTreeService $cityTreeService)
    {
        $this->request = $request;
        $this->service = $cityTreeService;
    }

    /**
     * 城市列表
     * @return ApiResponse
     * @url /area/city_tree/index
     */
    public function index(): ApiResponse
    {
        return ApiResponse::success($this->service->index());
    }

}
